package cn.tramy.pinxian.wind.util

import org.springframework.data.jpa.repository.JpaRepository

/**
 * Get-Update-Save
 */

fun <T> gus(uid: String, repository: JpaRepository<T, String>, update: T.() -> Unit) {
    repository.findById(uid).ifPresent { it.update();repository.save(it) }
}